package com.example.zzl.view.activity;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.view.View;

import com.example.zzl.R;
import com.example.zzl.databinding.ActivitySpecialInfoBinding;
import com.example.zzl.view.BaseActivity;
import com.example.zzl.viewmodel.HomeFragment.SpecialInfoPresenter;

public class SpecialInfoActivity extends BaseActivity implements SpecialInfoPresenter.SpecialInfoCallback {

    private ActivitySpecialInfoBinding db;
    private SpecialInfoPresenter presenter;
    private String headTitle;
    private int iSpecialId;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        getSupportActionBar().hide();
        super.onCreate(savedInstanceState);
        initIntent();
        db = DataBindingUtil.setContentView(this, R.layout.activity_special_info);
        presenter = new SpecialInfoPresenter(this, this, db);
        presenter.init();
        presenter.initView();
        presenter.loadData(Integer.toString(iSpecialId));
    }

    private void initIntent() {
        Bundle bundle = getIntent().getExtras();
        headTitle = bundle.getString("headTitle");
        iSpecialId = bundle.getInt("iSpecialID", 0);
    }


    @Override
    public String getHeadTitle() {
        return headTitle;
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case -1:
                setResult(200);
                finish();
                break;

            case 0:

                break;

            default:
                break;
        }
    }
}
